package top.yangbuyi.utils;

import cn.hutool.core.lang.UUID;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.crypto.hash.Md5Hash;


/**
 * @description: 杨不易网站:www.yangbuyi.top
 * @program: yangbuyiopenHis2020
 * @ClassName: AppMd5Utils
 * @create: 2020-09-07 23:50
 * @author: yangbuyi
 * @since： JDK1.8
 * @AppMd5Utils: 密码加密$
 **/

public class AppMd5Utils {

	  /**
	   * 生成盐
	   */
	  public static String createSalt(){
			return UUID.randomUUID().toString().replace("-","").toUpperCase();
	  }

	  /**
	   * 生成加密字符串
	   */
	  public static String md5(String source,String salt,Integer hashIterations){
			return new Md5Hash(source,salt,hashIterations).toString();
	  }

	  public static void main(String[] args) {
			System.out.println(md5("907654","9ED13A792A6B438D9AC3FC1C90F2F06A",2));
	  }

}
